#pragma once

#include <SFML\Graphics.hpp>
#include <Windows.h>
#include <Xinput.h>
#include "DisplayManager.h"

class InputHandler
{
	public:
		static InputHandler* GetInstance();
		void Destroy();

		bool isPressed(sf::Keyboard::Key key);
		bool isPressed(sf::Mouse::Button bButton);

		std::vector<bool> getAllCurrentMousePresses();
		std::vector<bool> getAllPreviousMousePresses();

		bool isMouseDownFirst(sf::Mouse::Button MB);
		bool isMouseUpFirst(sf::Mouse::Button MB);

		bool isKeyPressedFirst(sf::Keyboard::Key key);
		bool isKeyReleased(sf::Keyboard::Key key);

		sf::Vector2i GetMousePosition();
	
		void Update();
		void Initialize();

	private:
		InputHandler();
		~InputHandler();
	
		static InputHandler* m_xInstance;

		bool m_xKey;
		sf::Event* m_xEvents;
		std::vector<bool> m_bMBCurrentState;
		std::vector<bool> m_bMBPrevState;
		std::vector<bool> m_bKeys;
		std::vector<bool> m_bPrevKeys;

		sf::Mouse::Button MouseButtons(int i);
};
